<?
if(!defined ('U_MOD'))
{
	echo"<meta http-equiv='refresh' content='0;url=/index.php'>";
	exit;
}

if (!isset($mkey) || empty($mkey) || $mkey=='' || is_numeric($mkey))
{
	$moduleSelected='portal';
}else
	$moduleSelected=$mkey;

include 'topmenu.php';

print '<form name="ModSelect" method="post" action="'.$portal_url.'/admin.php?amk='.$amk.'">';
	GetModuleList($moduleSelected,0,'mkey',_FOR_ALL_,'','');
	print'<input type="submit" value="'._OK_.'">
</form>';

	$query=mysql_query("SELECT * FROM ".$PortalPref."options WHERE option_mkey='".$moduleSelected."'");
	if (mysql_num_rows($query)>0)
	{
		print '<table width="100%" align="center">';
			$dd=1;
			while($result=mysql_fetch_assoc($query))
			{
				if(isset($mkey) && $mkey!='' && !is_numeric($mkey))
					$addToLink='&mkey='.$mkey;
				else
					$addToLink='';
				$modifyIcon='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=manage&act=3&pid='.$result['option_id'].''.$addToLink.'"><img src="'.$portal_url.'/images/icon/16x16_png/modify.png" id="img-action" title="'._MODIFY_TITLE_.'" ></a>';

				if ($result['option_sys']==1)
				{
					$sysIcon='<img src="'.$portal_url.'/images/icon/16x16_png/alert.png" id="img-action" title="'._SYSTEM_PARAMETR_.'" >';
					$delIcon='';
					$wrenchIcon='';
				}else
				{
					$wrenchIcon='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=manage&act=4&pid='.$result['option_id'].'"><img src="'.$portal_url.'/images/icon/16x16_png/wrench.png" id="img-action" title="'._CHANGE_PARAMETR_TITLE_.'" ></a>';
					$sysIcon='';
					$delIcon='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=manage&act=6&pid='.$result['option_id'].''.$addToLink.'" onClick="return confirm(\''._CLICKDEL_.' '._THISPARAMETR_.': '.$result['option_name'].'\');"><img src="'.$portal_url.'/images/icon/16x16_png/delete.png" id="img-action" title="'._DEL_TITLE_.'" ></a>';
				}

				$dd++;$iclass = ($dd % 2) ? "even" : "odd";

				$TypeValue=GetOptionTypeVaLue($result['option_value'], $result['option_permissible'], $result['option_type'], 'table');



				print '<tr id="'.$iclass.'">
					<td>
						'.pEcho($result['option_name']).'
					</td>
					<td>
						'.$TypeValue.'
					</td>
					<td id="column-action">
						'.$modifyIcon.''.$wrenchIcon.''.$sysIcon.''.$delIcon.'
					</td>
				</tr>';
			}
		print'</table>';
	}
?>